<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>触发cookie案例</title>
</head>

<body onload="checkCookies()">

    <script>
        function checkCookies() {
            if (navigator.cookieEnabled == true) {
                alert("Cookies 可用")
            } else {
                alert("Cookies 不可用")
            }
        }
    </script>
    <p>弹窗-提示浏览器 cookie 是否可用。</p>

</body>

</html>